// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial

SubElem := Rectangle {
    property <int> value: sub.value;
    callback change();
    change => { sub.value += 44; }
    sub := Rectangle {
        property <int> value: 55;
    }
}

TestCase := Rectangle {
    callback change();
    change => { sub.change() }
    property <int> toplevel: sub.value + 1;
    sub := SubElem { }
}


/*

```rust
let instance = TestCase::new().unwrap();
assert_eq!(instance.get_toplevel(), 56);
instance.invoke_change();
assert_eq!(instance.get_toplevel(), 56+44);
```


```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert_eq(instance.get_toplevel(), 56);
instance.invoke_change();
assert_eq(instance.get_toplevel(), 56+44);
```

```js
var instance = new slint.TestCase({});
assert.equal(instance.toplevel, 56);
instance.change();
assert.equal(instance.toplevel, 56+44);
```

*/
